<?php

namespace App\Http\Requests\Api\V1_9_1;

use Illuminate\Foundation\Http\FormRequest;

class PersonalAccountWithdrawRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'bank_id' => 'required',
            'withdraw_money' => 'required',
            'pay_password' => 'required|min:6|max:6',
        ];
    }

    public function messages()
    {
        return [
            'bank_id.required' => '储蓄卡id不能为空',
            'withdraw_money.required' => '提现金额不能为空',
            'pay_password.required' => '支付密码不能为空',
            'pay_password.min' => '请输入6位数字的支付密码',
            'pay_password.max' => '请输入6位数字的支付密码',
        ];
    }
}
